export function timestampToDateTime(timestamp, format = 'YYYY/MM/DD HH:mm:ss') {
	// 将时间戳转换为毫秒
	let date = new Date(timestamp);
	// 获取年、月、日、小时、分钟、秒
	let year = date.getFullYear();
	let month = ('0' + (date.getMonth() + 1)).slice(-2);
	let day = ('0' + date.getDate()).slice(-2);
	let hours = ('0' + date.getHours()).slice(-2);
	let minutes = ('0' + date.getMinutes()).slice(-2);
	let seconds = ('0' + date.getSeconds()).slice(-2);
	// 替换格式中的对应部分
	let formattedDate = format
		.replace('YYYY', year)
		.replace('MM', month)
		.replace('DD', day)
		.replace('HH', hours)
		.replace('mm', minutes)
		.replace('ss', seconds);
	return formattedDate;
}
// 导出函数，以便其他模块可以引入使用
module.exports = {
	timestampToDateTime
};